﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace Loot
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main(string[] args)
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			string filename = "";

			if (args.Length == 1)
				filename = args[0];

			if (filename != "")
			{
				Editor e1 = new Editor();
				e1.Filename = filename;
				e1.ShowDialog();
			}
			else
			{
				bool keeploading = true;
				while (keeploading)
				{
					filename = "";
					Form1 f1 = new Form1();
					f1.Filename = "";
					DialogResult f1dr = f1.ShowDialog();
					if (f1dr == DialogResult.OK)
					{
						filename = f1.Filename;
					}
					else
					{
						keeploading = false;
					}

					if (filename != "")
					{
						Editor e1 = new Editor();
						e1.Filename = filename;
						e1.ShowDialog();
					}
				}
			}
		}
	}
}
